import { axios } from '@/utils/request'
import api from '../manage'
/**
 * 课程管理
 * */
// 课程列表查询
export function queryCouresList (courseParam) {
  return axios({
    url: '/course/query',
    method: 'post',
    data: courseParam
  })
}

// 课程列表新增
export function couresInsert (model) {
  return axios({
    url: '/course/insert',
    method: 'post',
    data: model
  })
}
// 课程列表编辑
export function couresup (model) {
  return axios({
    url: '/course/up',
    method: 'post',
    data: model
  })
}


// 课程列表删除 delete
export function couresDelete (id) {
  return axios({
    url: '/course/delete/' + id,
    method: 'post',
  })
}
// 课程列表上下架
export function updateForType (model) {
  return axios({
    url: '/course/updateForType',
    method: 'post',
    data: model
  })
}
// 上传章节视频
export function uploadVideo (file) {
  return axios({
    url: '/live/uploadVideo',
    method: 'post',
    data: file,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
// 课程类型列表查询
export function courseTypequery (courseParam) {
  return axios({
    url: '/courseType/query',
    method: 'post',
    data: courseParam
  })
}
// 课程类型新增
export function courseTypeinsert (courseParam) {
  return axios({
    url: '/courseType/insert',
    method: 'post',
    data: courseParam
  })
}
// 课程类型编辑
export function courseTypeup (courseParam) {
  return axios({
    url: '/courseType/up',
    method: 'post',
    data: courseParam
  })
}
// 课程类型删除
export function courseTypedelete (id) {
  return axios({
    url: '/courseType/delete/'+id,
    method: 'post',
  })
}
// 获取课程资料
export function courseedit (id) {
  return axios({
    url: '/course/edit/'+id,
    method: 'post',
  })
}
// 文件导入(0:课程类型导入;1:法律法规导入;2:视频资料导入;3:题库；4：题目;5重点排污企业导入;6:警示教育企业导入) - importFile
export function importFile (courseParam) {
  return axios({
    url: '/courseType/importFile',
    method: 'post',
    data: courseParam
  })
}





export function getExamListForDoor (courseParam) {
  return axios({
    url: ('/exam/getExamListForDoor'),
    method: 'post',
    data: courseParam
  })
}
export function beginExam (courseParam) {
  return axios({
    url: ('/examRecord/beginExam'),
    method: 'post',
    data: courseParam
  })
}
export function selectErrorQuestionList (courseParam) {
  return axios({
    url: ('/examRecord/selectErrorQuestionListByQuestionType'),
    method: 'post',
    data: courseParam
  })
}
export function testExam (courseParam) {
  return axios({
    url: ('/examRecord/testExam'),
    method: 'post',
    data: courseParam
  })
}
export function questionOption (courseParam) {
  return axios({
    url: ('/questionOption/query'),
    method: 'post',
    data: courseParam
  })
}